package com.wuliu.system.service.impl;

import java.util.List;
import com.wuliu.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.wuliu.system.mapper.TspDrivingRecordMapper;
import com.wuliu.system.domain.TspDrivingRecord;
import com.wuliu.system.service.ITspDrivingRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 行车记录Service业务层处理
 * 
 * @author realue
 * @date 2023-11-04
 */
@Service
public class TspDrivingRecordServiceImpl extends ServiceImpl<TspDrivingRecordMapper, TspDrivingRecord> implements ITspDrivingRecordService {
    @Resource
    private TspDrivingRecordMapper tspDrivingRecordMapper;

    /**
     * 查询行车记录
     * 
     * @param id 行车记录主键
     * @return 行车记录
     */
    @Override
    public TspDrivingRecord selectTspDrivingRecordById(String id) {
        return tspDrivingRecordMapper.selectTspDrivingRecordById(id);
    }

    /**
     * 查询行车记录列表
     * 
     * @param tspDrivingRecord 行车记录
     * @return 行车记录
     */
    @Override
    public List<TspDrivingRecord> selectTspDrivingRecordList(TspDrivingRecord tspDrivingRecord) {
        return tspDrivingRecordMapper.selectTspDrivingRecordList(tspDrivingRecord);
    }

    /**
     * 新增行车记录
     * 
     * @param tspDrivingRecord 行车记录
     * @return 结果
     */
    @Override
    public int insertTspDrivingRecord(TspDrivingRecord tspDrivingRecord) {
        tspDrivingRecord.setCreateTime(DateUtils.getNowDate());
        return tspDrivingRecordMapper.insertTspDrivingRecord(tspDrivingRecord);
    }

    /**
     * 修改行车记录
     * 
     * @param tspDrivingRecord 行车记录
     * @return 结果
     */
    @Override
    public int updateTspDrivingRecord(TspDrivingRecord tspDrivingRecord) {
        tspDrivingRecord.setUpdateTime(DateUtils.getNowDate());
        return tspDrivingRecordMapper.updateTspDrivingRecord(tspDrivingRecord);
    }

    /**
     * 批量删除行车记录
     * 
     * @param ids 需要删除的行车记录主键
     * @return 结果
     */
    @Override
    public int deleteTspDrivingRecordByIds(String[] ids) {
        return tspDrivingRecordMapper.deleteTspDrivingRecordByIds(ids);
    }

    /**
     * 删除行车记录信息
     * 
     * @param id 行车记录主键
     * @return 结果
     */
    @Override
    public int deleteTspDrivingRecordById(String id) {
        return tspDrivingRecordMapper.deleteTspDrivingRecordById(id);
    }
}
